/*

Input: $rawdata/schuloffensive/Wahllokale_merge.xlsx [school polling places with renovation information]

Stat on relation of school renovation programm ("schuloffensive") and polling place unavailability

https://risi.muenchen.de/risi/ [accessed November 2023]

*/

*import cases and save unique polling places with construction work after 2014
	tempfile pp_merge
	import excel "$rawdata/schuloffensive/Wahllokale_merge.xlsx", clear first sheet("schuloffensive processed")
	bys wl_id (wahl_id): keep if _n==1
	keep wl_id
	save `pp_merge'


* how many (and which) schools went from active to inactive between 2014 and 2020?
	use "$newdata/wahllokal_change.dta", clear
	distinct wl_id // 299 distinct polling places

* KEEP: Schools going from active to inactive since 2017
	keep if wl_dropped==1 & wahl_id>=5 & wl_school==1
	distinct wl_id // 54 distinct polling places that are schools and with relevant change since 2017
	bys wl_id (wahl_id): keep if _n==1

* merge with construction plan
	merge m:1 wl_id using `pp_merge', assert(1 3)

* % part of the programm (_merge==3) ?
	tab _merge // 61%
	